package com.mianyang.zhangsan.common.base;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author jiangjr
 * @date 2022-10-23
 */
@Data
public class R {
    private Integer code;
    private String message;
    private Map<String, Object> data;

    public R() {}

    public R(Integer code, String message) {
        this.code = code;
        this.message = message;
        this.data = new HashMap<>();
    }

    public R(Integer code, String message, Map<String, Object> data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public void put(String key, Object value) {
        data.put(key, value);
    }
}
